
from selenium import webdriver

# 定义一个函数，来获取不同浏览器的驱动
def getDriver(driverStr):
    if driverStr=="safari":
        driver = webdriver.Safari()
    elif driverStr=="chrome":
        driver = webdriver.Chrome()
    elif driverStr=="firefox":
        driver = webdriver.Firefox()
    else:
        driver = webdriver.Edge()
    return driver

#定义一个类，封装不同的操作
class Base:
    def __init__(self,driver:webdriver):
        self.driver=driver
    #打开某个网页
    def open(self,url):
        self.driver.get(url)
        #隐式等待
        self.driver.implicitly_wait(5)
    #退出浏览器
    def quit(self):
        self.driver.quit()
    #关闭当前网页



